import { axios } from '@/utils/request'

/**
 * 分页查询采集设备
 *
 * @author ssy
 * @date 2021/09/14 10:36
 */
export function page (parameter) {
  return axios({
    url: '/bizGateway/page',
    method: 'get',
    params: parameter
  })
}

// 查询所有未申请授权、授权过期、以及审核授权失败的网关
export function listNoGrant (parameter) {
  return axios({
    url: '/bizGateway/listNoGrant',
    method: 'get',
    params: parameter
  })
}

export function treeList (parameter) {
  return axios({
    url: '/bizGateway/tree',
    method: 'get',
    params: parameter
  })
}

export function pageGataway (parameter) {
  return axios({
    url: '/bizGateway/page',
    method: 'get',
    params: parameter
  })
}

export function guidePageGataway (parameter) {
  return axios({
    url: '/bizGateway/guidePage',
    method: 'get',
    params: parameter
  })
}


/**
 * 增加采集设备
 *
 * @author ssy
 * @date 2021/09/14 10:36
 */
export function add (parameter) {
  return axios({
    url: '/bizGateway/add',
    method: 'post',
    data: parameter
  })
}

export function addGateway (parameter) {
  return axios({
    url: '/bizGateway/addGateway',
    method: 'post',
    data: parameter
  })
}

/**
 * 导入采集设备
 *
 * @author ssy
 * @date 2021/09/14 10:36
 */
export function importGateway (parameter) {
  return axios({
    url: '/bizGateway/importGateway',
    method: 'post',
    data: parameter
  })
}

/**
 * 编辑采集设备
 *
 * @author ssy
 * @date 2021/09/14 10:36
 */
export function edit (parameter) {
  return axios({
    url: '/bizGateway/edit',
    method: 'post',
    data: parameter
  })
}

export function editGateway (parameter) {
  return axios({
    url: '/bizGateway/editGateway',
    method: 'post',
    data: parameter
  })
}

/**
 * 查看详情采集设备
 *
 * @author ssy
 * @date 2021/09/14 10:36
 */
export function detail (parameter) {
  return axios({
    url: '/bizGateway/detail',
    method: 'get',
    params: parameter
  })
}

/**
 * 查看详情采集设备
 *
 * @author ssy
 * @date 2021/09/14 10:36
 */
export function getConfig (parameter) {
  return axios({
    url: '/bizGateway/getConfig',
    method: 'get',
    params: parameter
  })
}

/**
 * 查看详情采集设备
 *
 * @author ssy
 * @date 2021/09/14 10:36
 */
export function updateConfig (parameter) {
  return axios({
    url: '/bizGateway/updateConfig',
    method: 'post',
    data: parameter
  })
}

/**
 * 删除采集设备
 *
 * @author ssy
 * @date 2021/09/14 10:36
 */
export function del (parameter) {
  return axios({
    url: '/bizGateway/delete',
    method: 'post',
    data: parameter
  })
}

export function gatewayList (parameter) {
  return axios({
    url: '/bizGateway/list',
    method: 'get',
    params: parameter
  })
}

export function gatewayListAll (parameter) {
  return axios({
    url: '/bizGateway/listAll',
    method: 'get',
    params: parameter
  })
}

export function gatewayByGatewayCode (parameter) {
  return axios({
    url: '/bizGateway/gatewayByGatewayCode',
    method: 'get',
    params: parameter
  })
}

export function changeSwitch (parameter) {
  return axios({
    url: '/bizGateway/changeSwitch',
    method: 'post',
    data: parameter
  })
}
// 批量修改网关数据上报开关状态
export function batchChangeDataReportStatus (parameter) {
  return axios({
    url: '/bizGateway/batchChangeDataReportStatus',
    method: 'post',
    data: parameter
  })
}

export function selfTest (parameter) {
  return axios({
    url: '/bizGateway/selfTest',
    method: 'get',
    params: parameter
  })
}

export function initGatewayPage (parameter) {
  return axios({
    url: '/bizGateway/initGatewayPage',
    method: 'get',
    params: parameter
  })
}

// 查询办公系统上的现有网关授权信息
export function queryGrantInfo () {
  return axios({
    url: '/bizGateway/queryGrantInfo',
    method: 'get'
  })
}

// 批量添加网关授权申请
export function batchAddApplicationRecord (parameter) {
  return axios({
    url: '/bizGateway/batchAddApplicationRecord',
    method: 'post',
    data: parameter
  })
}

// 批量添加网关授权申请
export function syncGatewayGrant (parameter) {
  return axios({
    url: '/bizGateway/syncGatewayGrant',
    method: 'post',
    data: parameter
  })
}
